import java.util.Arrays;

public class SolutionInterview17_19 {
    public int[] missingTwo(int[] nums) {
        int[] hash=new int[nums.length+3];
        for (int num : nums) {
            hash[num]++;
        }
        int[] ans=new int[2];
        int now=0;
        for (int i=1;i<=nums.length+2;i++){
            if (hash[i]==0){
                ans[now++]=i;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(Arrays.toString(new SolutionInterview17_19().missingTwo(new int[]{1})));
    }
}
